{extend name="platform/base" /}
{block name="resources"/}
<link rel="stylesheet" type="text/css" href="ADMIN_CSS/member_list.css" />
<script type="text/javascript" src="__STATIC__/My97DatePicker/WdatePicker.js"></script>
<style>
.table>tbody#list>tr>td>img{max-height:60px;}
.border-gray{border-color: #f1f1f1}
.border-solid{border-width:1px; border-style: solid;}
.gray{color: #999;}
.order-count{margin-right:20px;}
.right-indent:after{
	content:'';
	display:inline-block;
	width:30%;
}
</style>

{/block}

 {block name="main"}
 
	<div class="bg-white panel-body border-solid border-gray">
		<div class="col-sm-12">会员身份</div>
		<div class="row panel-body">
			<div class="col-sm-2">是否为推广员：<span>{if condition="$user_account_info['is_promoter'] eq 1"}是{else/}否{/if}</span></div>
			<!-- <div class="col-sm-2">是否为股东：<span>{if condition="$user_account_info['is_partner'] eq 1"}是{else/}否{/if}</span></div> -->
			<div class="col-sm-2">是否为代理：<span>{if condition="$user_account_info['is_region_agent'] eq 1"}是{else/}否{/if}</span></div>
			<div class="col-sm-2"></div>
		</div>
		<div class="row b-t border-gray" style="margin-bottom: 12px;"></div>
		
		<div class="col-sm-12">推广员信息</div>
		<div class="row panel-body">
			<div class="col-sm-2">推广编号：<span>{$promoter_info['promoter_no']}</span></div>
			<div class="col-sm-2">会员账号：<span>{$promoter_info['real_name']}</span></div>
			<div class="col-sm-2">推广等级：<span>{$promoter_info['level_name']}</span></div>
			<div class="col-sm-2">店铺名称：<span>{$promoter_info['promoter_shop_name']}</span></div>
			<div class="col-sm-2">推广人数：<span>{$promoter_info['promoter_num']}</span></div>
			<div class="col-sm-2">粉丝数：<span>{$promoter_info['fans_num']}</span></div>
			<div class="col-sm-2">
				{if condition = "$promoter_info.parent_realname eq null"}
					上级推广员：<span>无</span>
				{else /}
					上级推广员：<span>{$promoter_info['parent_realname']}</span>
				{/if}
			</div>
		</div>
		<div class="row b-t border-gray" style="margin-bottom: 12px;"></div>
		
		<div class="col-sm-12">账户信息</div>
		<div class="row panel-body">
			<div class="col-sm-2">总佣金：<span>{$user_account_info['commission']}</span></div>
			<div class="col-sm-2">可提现佣金：<span>{$user_account_info['commission_cash']}</span></div>
			<div class="col-sm-2">已提现佣金：<span>{$user_account_info['commission_withdraw']}</span></div>
			<div class="col-sm-2">分销佣金：<span>{$user_account_info['commission_promoter']}</span></div>
			<!-- <div class="col-sm-2">股东分红：<span>{$user_account_info['commission_partner']}</span></div>
			<div class="col-sm-2">股东全球分红：<span>{$user_account_info['commission_partner_global']}</span></div> -->
			<div class="col-sm-2">区域代理佣金：<span>{$user_account_info['commission_region_agent']}</span></div>
			
		</div>
	</div>

<div class="row padder-v">
		<div class="col-sm-5"></div>
		<div class="col-sm-2" >
			<div class="input-group">
				<input type="text" id='startDate' placeholder="请选择交易开始日期" class="input-sm form-control" onclick="WdatePicker()"/>
			</div>
		</div>
		<div class="col-sm-2" >
			<div class="input-group">
			<input type="text" id='endDate' placeholder="请选择交易结束日期" class="input-sm form-control" onclick="WdatePicker()" />

			</div>
		</div>
		<div class="col-sm-2" >
			<select id="account_type" class="input-sm form-control" >	
				<option value="">请选择交易类型</option>
				{volist name = "account_type" id="vo"}
				<option value="{$vo.type_id}">{$vo.type_name}</option>
				{/volist}
			</select>
		</div>
		<div class="col-sm-1">
			<button class="btn btn-sm btn-default" type="button"
				onclick="search()">搜索</button>
		</div>
</div>
<section class="panel panel-default">
	<div class="table-responsive">
		<table class="table table-striped b-light text-sm">
			<colgroup>
				<col style="width: 8%;">
				<col style="width: 8%;">
				<col style="width: 8%;">
				<col style="width: 8%;">
			</colgroup>
			<thead>
				<tr>						
					<th class="center">交易日期</th>					
					<th class="right right-indent">金额</th>
					<th>交易类型</th>						
					<th>描述</th>
				</tr>
			</thead>
	
			<tbody id="list"></tbody>
		</table>	
	</div>
	{include file="platform/page" /}
</section>



{/block}
 
{block name="script"}
<script type="text/javascript">

var promoter_uid = "{$promoter_uid}";

//查询
$(function(){
	LoadingInfo(1);
});	
	function LoadingInfo(page_index) {
	
		var user_name = $("#userName").val();
		var user_phone = $("#userTel").val();
		var role = $("#role").val();
		
		$.ajax({
			type : "post",
			url : "{:__URL('PLATFORM_MAIN/Distribution/promoterAccount')}",
			async : true,
			data : {
				"page_index" : page_index,
				"page_size" : $("#showNumber").val(),
				"uid" : promoter_uid,
				"startDate" : $('#startDate').val(),
				"endDate" : $('#endDate').val(),
				"account_type" : $('#account_type').val()
			},
			success : function(data) {
				//console.log(data);
				var html = '';
				$("#total_count_num").text(data["total_count"]);
				$("#page_count_num").text(data["page_count"]);
				$("#page_count").val(data["page_count"]);
				$("#pageNumber a").remove();
				if (data["data"].length > 0) {
					for (var i = 0; i < data["data"].length; i++) {
						var item_data = data['data'][i];
						html += '<tr align="center">';
						html += '<td>' + timeStampTurnTime(data["data"][i]["create_time"])+'</td>';
						html += '<td align="right" class="right-indent">' + data["data"][i]["money"] +'</td>';
						html += '<td align="left">' + data["data"][i]["type_name"] +'</td>';
						html += '<td align="left">' + data["data"][i]["text"] +'</td>';
						html += '</tr>';
					}
				} else {
					html += '<tr align="center"><td colspan="4" style="text-align:center;">暂无符合条件的数据记录</td></tr>';
				}
				$("#list").html(html);
 					var totalpage = $("#page_count").val();
				if (totalpage == 1) {
					changeClass("all");
				}
				var $html = pagenumShow(jumpNumber,totalpage,{$pageshow})
				$("#pageNumber").append($html);
				
			}
		});
	}
	//全选
	function CheckAll(event){
		var checked = event.checked;
		$(".style0list tbody input[type = 'checkbox']").prop("checked",checked);
	}
	$("#search_text").keypress(function(e){
		if(e.keyCode == 13){
			LoadingInfo(1);
		}
	});
	
	function search(){
		LoadingInfo(1);
	}
</script>
{/block}
